﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Game.Utilities
{
    [Serializable]
    public class DBAccountBetLog
    {
        public virtual void Dispose()
        {
        }

        public long AccountID { get; set; }
        public int BetValue { get; set; }
        //public int RoomType { get; set; }
        public string BetLine { get; set; }
        public string WinLine { get; set; }
        public DateTime CreateDate { get; set; }

        public void Insert()
        {
            DBHelper db = new DBHelper(Config.Config.LogDBConnectionString);
            SqlCommand oCommand = new SqlCommand("sp_AccountBetLog_Insert");
            oCommand.CommandType = CommandType.StoredProcedure;
            oCommand.Parameters.Add(new SqlParameter("@AccountID", AccountID));
            oCommand.Parameters.Add(new SqlParameter("@BetValue", BetValue));
            //oCommand.Parameters.Add(new SqlParameter("@RoomType", RoomType));
            oCommand.Parameters.Add(new SqlParameter("@BetLine", BetLine));
            oCommand.Parameters.Add(new SqlParameter("@WinLine", WinLine));

            db.ExecuteNonQuery(oCommand);
        }

        public List<DBAccountBetLog> GetListJackPot(long accountId)
        {
            List<DBAccountBetLog> lst = new List<DBAccountBetLog>();

            DBHelper db = new DBHelper(Config.Config.LogDBConnectionString);
            SqlCommand oCommand = new SqlCommand("sp_AccountBet_Log_GetList");
            oCommand.CommandType = CommandType.StoredProcedure;

            lst = db.GetList<DBAccountBetLog>(oCommand);

            return lst;
        }
    }
}
